//
//  LoginViewController.m
//  projecthz
//
//  Created by tali on 16/8/1.
//  Copyright © 2016年 tali. All rights reserved.
//

#import "HZLoginViewController.h"
#import "ClientInfo.h"

@interface HZLoginViewController ()

@property (nonatomic, strong) UIButton *testBtn;

@end

@implementation HZLoginViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    
    [self configUI];
}

- (void)configUI{
    self.view.backgroundColor = [UIColor whiteColor];
    
    [self.view addSubview:self.testBtn];
    [self.testBtn mas_makeConstraints:^(MASConstraintMaker *make) {
        make.center.equalTo(self.view);
        make.width.mas_equalTo(80.f);
        make.height.mas_equalTo(40.f);
    }];
    
    [[ClientInfo sharedInstance] setUserLocationWithCoordinate2D:CLLocationCoordinate2DMake(30.50604800, 114.40629600)];
}

#pragma mark - Action Methods
- (void)goToHomepage{
    [[NSNotificationCenter defaultCenter] postNotificationName:kNotificationShowHomePageVC object:nil];
}

#pragma mark - Getters
-(UIButton *)testBtn{
    if (!_testBtn) {
        _testBtn = [UIButton new];
        [_testBtn setTitle:@"goToHomepage" forState:UIControlStateNormal];
        [_testBtn setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
        _testBtn.titleLabel.font = [UIFont systemFontOfSize:14.f];
        _testBtn.backgroundColor = [UIColor redColor];
        [_testBtn addTarget:self action:@selector(goToHomepage) forControlEvents:UIControlEventTouchUpInside];
    }
    return _testBtn;
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

@end
